
var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
    value: true
});
require('./Plant10')
var $2pvzChannel = require("pvzChannel");
var $2SceneStage = require("SceneStage");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_AdBombUI = /* */ function(_cc$Component) {
    babel_inherits(r, _cc$Component);
    var _super = babel_createSuper(r);

    function r() {
        var _this;
        babel_classCallCheck(this, r);
        _this = _super.apply(this, arguments);
        _this.bt1 = null;
        _this.bt_heighLight = null;
        _this.close = null;
        _this.video = null;
        return _this;
    }
    babel_createClass(r, [{
        key: "onLoad",
        value: function onLoad() {
            var _this2 = this;
            this.bt1.on(cc.Node.EventType.TOUCH_END, function() {
                $2pvzChannel.pvzChannel.instance().showVideo({
                    sucCall() {
                        $2SceneStage.default.instance.shootBomb();
                        _this2.hide();
                    },
                    failCall() {},
                    endCall() {}
                });
            }, this);
            this.close.on(cc.Node.EventType.TOUCH_END, function() {
                _this2.hide();
            }, this);
            cc.tween(this.bt_heighLight).repeatForever(cc.tween().to(.3, {
                y: 0
            }).to(.3, {
                y: -30
            })).start();
        }
    }, {
        key: "show",
        value: function show(e) {
            $2SceneStage.default.instance.pause();
            $2pvzChannel.pvzChannel.instance().channel.indexOf("wx") >= 0 && $2pvzChannel.pvzChannel.instance().getCtrl("p4") && (this.video.active = false);
        }
    }, {
        key: "hide",
        value: function hide() {
            cc.Tween.stopAllByTarget(this.bt_heighLight);
            this.node.destroy();
            $2SceneStage.default.instance.resume();
        }
    }]);
    return r;
}(cc.Component);
cc__decorate([ccp_property(cc.Node)], def_AdBombUI.prototype, "bt1", undefined);
cc__decorate([ccp_property(cc.Node)], def_AdBombUI.prototype, "bt_heighLight", undefined);
cc__decorate([ccp_property(cc.Node)], def_AdBombUI.prototype, "close", undefined);
cc__decorate([ccp_property(cc.Node)], def_AdBombUI.prototype, "video", undefined);
def_AdBombUI = cc__decorate([ccp_ccclass], def_AdBombUI);
exports.default = def_AdBombUI;